//нам нужен переносимый таймер. вот он!
#include <assert.h>
#ifdef WIN32
#include <windows.h>
#define DELTA_EPOCH_IN_MICROSECS  11644473600000000ULL
double gettime_f()
{
	FILETIME ft;
	uint64_t tmp;
	//get windows time (windows counts time in 100ns periods
    GetSystemTimeAsFileTime(&ft);
	//convert it to single 64bit value and scale to seconds
    tmp = ft.dwHighDateTime;
    tmp <<= 32;
    tmp |= ft.dwLowDateTime;
	return  0.0000001*(double)tmp;
}
#else
#include <time.h>
double gettime_f()
{
	struct timespec ts;
	//get unix time of day
	assert(0==clock_gettime(CLOCK_MONOTONIC, &ts));
	return (double)ts.tv_sec +
	        0.0000001*(double)ts.tv_nsec;
}
#endif
